package day0729.oopTest;

class Master{//主人
    String name;
    void feedPet(Cat  c){
        System.out.println(name+"喂宠物"+c.name);
    }
}
//给两个对象的name赋值，  调用feedPet()方法

class  Cat{//宠物
    String name;
}






public class TestPet {
    public static void main(String[] args) {
        Cat   xiaoHua=new Cat();
        xiaoHua.name="小花";
        Master   m=new Master();
        m.name="小明";
        m.feedPet( xiaoHua  );
    }
}
